<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/page/inc/taglib.jsp"%>
<div class="pageHeader">
	<form id="pagerForm" onsubmit="return navTabSearch(this);" action="${pageContext.request.contextPath}/shop/shop/list" method="post">
		<!-- 分页表单参数 -->
		<%@include file="/WEB-INF/page/inc/pageForm.jsp"%>
		<!-- 需要排序的字段 -->
		<input type="hidden" name="orderField" value="${requestScope.dwzPageBean.countResultMap.orderField}" />
		<!-- 正序倒序 -->
		<input type="hidden" name="orderDirection" value="${requestScope.dwzPageBean.countResultMap.orderDirection}" />
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<!-- <td>店铺名称：<input type="text" name="shopName"  size="30" placeholder="请输入店铺名称" /></td> -->
					<td>店铺名称： <input size="30" placeholder="请输入店铺名称" name="org1.shopName" type="text" postField="shopName" suggestFields="shopName" suggestUrl="${pageContext.request.contextPath}/shop/shop/getShopName" lookupGroup="org1" value="${requestScope.dwzPageBean.countResultMap.shopName}" />
					</td>
					<%-- <td>店铺编号：<input type="text" name="shopNum" value="${requestScope.dwzPageBean.countResultMap.shopNum}" size="30" placeholder="请输入店铺编号" /></td> --%>
					<td>店铺编号： <input size="30" placeholder="请输入店铺编号" name="org2.shopNum" type="text" postField="shopNum" suggestFields="shopNum" suggestUrl="${pageContext.request.contextPath}/shop/shop/getShopNum" lookupGroup="org2" value="${requestScope.dwzPageBean.countResultMap.shopNum}" />
					</td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<shiro:hasPermission name="/shop/shop/shopexport">
				<li><a href="${pageContext.request.contextPath}/shop/shop/shopexport" target="dwzExport" targetType="navTab" title="是要导出这些记录吗?" class="icon"><span>导出EXCEL</span></a></li>
			</shiro:hasPermission>
			<shiro:hasPermission name="/shop/shop/toInsert">
				<li><a class="add" href="${pageContext.request.contextPath}/shop/shop/toInsert" rel="insert" target="dialog" mask="true" width="820" height="460"><span>添加</span></a></li>
			</shiro:hasPermission>
			<%-- <li><a class="delete" href="${pageContext.request.contextPath}/shop/shop/delete" rel="id" target="selectedTodo" title="确定要删除吗？" warn="请最小选择一条记录" mask="true"><span>批量删除</span></a></li> --%>
		</ul>
	</div>
	<table class="table" targetType="navTab" asc="asc" desc="desc" width="100%" layoutH="138">
		<thead>
			<tr>
				
				<th orderField="shop_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺名称</th>
				<th orderField="shop_num" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_num'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺编号</th>
				<th orderField="contacts" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'contacts'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系人</th>
				<th orderField="contact_number" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'contact_number'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>联系电话</th>
				<th orderField="area_name" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'area_name'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>所在区域（省市区县）</th>
				
				
				<!-- 合同编号、签约日期、店面级别、店铺布局、招商经理、区域经理、运营督导、开业老师、店面地址、备注、是否样板店 -->
				<th orderField="ctno" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'ctno'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>合同编号</th>
				<th orderField="sgtm" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'sgtm'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>签约日期  </th>
				<th orderField="stle" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'stle'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店面级别</th>
				<th orderField="layout" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'layout'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺布局</th>
				<th orderField="imid" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'imid'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>招商经理</th>
				<th orderField="rgid" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'rgid'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>区域经理</th>
				<th orderField="opid" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'opid'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>运营督导</th>
				<th orderField="trid" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'trid'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>开业老师</th>
				<th orderField="remk"  width="150" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'remk'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>备注</th>
				<th orderField="template" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'template'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>是否样板店</th>
				
				
				
				
				<th orderField="add_time" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'add_time'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>增加时间</th>
				<th orderField="operator" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'operator'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>操作人</th>
				<th orderField="state" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'state'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>门店状态</th>
				<th orderField="shop_state" <c:if test="${requestScope.dwzPageBean.countResultMap.orderField == 'shop_state'}">class="${requestScope.dwzPageBean.countResultMap.orderDirection}"</c:if>>店铺状态</th>
				<th width="220">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:if test="${requestScope.dwzPageBean != null &&  requestScope.dwzPageBean.recordList != null }">
				<c:forEach var="record" items="${requestScope.dwzPageBean.recordList}" varStatus="status">
				
					<tr  ondblclick="openDetails(this)" target="dialog" href="${pageContext.request.contextPath}/shop/shop/toUpdate?id=${record.shopId}" title="编辑">
						<td>${record.shopName}</td>
						<td>${record.shopNum}</td>
						<td>${record.contacts}</td>
						<td>${record.contactNumber}</td>
						<td>${record.areaName}</td>
						<td>${record.ctno}</td>
<td><fmt:formatDate pattern="yyyy-MM-dd" value="${record.sgtm}" /></td>
<td>${record.stle}</td>
<td>${record.layout}</td>
<td>${record.imname}</td>
<td>${record.rgname}</td>
<td>${record.opname}</td>
<td>${record.trname}</td>
<td>${record.remk}</td>
<td>${record.template==0?'否':''}${record.template==1?'是':''}</td>
						<td><fmt:formatDate pattern="yyyy-MM-dd" value="${record.addTime}" /></td>
						<td>${record.operatorname}</td>
						<!-- 1-新客户、2-门店建设中、3-门店配货中、4-常规客户 -->
						<td>${record.state == 1 ? '新客户':''}${record.state == 2 ? '门店建设中':''}${record.state == 3 ? '门店配货中':''}${record.state == 4 ? '常规客户':''}</td>
						<!-- 0-停用、1-启用 -->
						<td style="color: gray;"><a id="aid">${record.shopState == 1 ? '启用':''}</a> ${record.shopState == 0 ? '停用':''}</td>
						<td><shiro:hasPermission name="/shop/shop/toUpdate">
								<a title="编辑" target="dialog" href="${pageContext.request.contextPath}/shop/shop/toUpdate?id=${record.shopId}" class="editBtn" mask="true" width="820" height="460"><span>编辑</span></a>
							</shiro:hasPermission> <shiro:hasPermission name="/shop/shop/stateShop">
								<a title="确定要${record.shopState==0?'启用':'停用'}吗？" mask="true" target="ajaxTodo" href="${pageContext.request.contextPath}/shop/shop/stateShop?shopId=${record.shopId}&shopState=${record.shopState==0?1:0}" class="${record.shopState==0?'startBtn':'stopBtn'}" mask="true"><span>${record.shopState==0?"启用":"停用"}</span></a>
							</shiro:hasPermission>
							<shiro:hasPermission name="/shop/shopFollow/list">
								<a title="跟进记录" target="navTab" rel="${pageContext.request.contextPath}/shop/shopFollow/list" href="${pageContext.request.contextPath}/shop/shopFollow/list?shopId=${record.shopId}" class="editBtn" mask="true"><span>跟进记录</span></a>
							</shiro:hasPermission>
					</tr>
				</c:forEach>
			</c:if>
		</tbody>
	</table>
	<!-- 分页条 -->
	<%@include file="/WEB-INF/page/inc/pageBar.jsp"%>
</div>
<style type="text/css">
#aid {
	text-decoration: none;
}
</style>